using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ObjectMapper.Benchmark.DataModel
{
    internal class ProductModelProductDescriptionCultureConfiguration :
        EntityTypeConfiguration<ProductModelProductDescriptionCulture>
    {
        public ProductModelProductDescriptionCultureConfiguration()
        {
            ToTable("Production.ProductModelProductDescriptionCulture");
            HasKey(x => new {x.ProductModelId, x.ProductDescriptionId, x.CultureId});

            Property(x => x.ProductModelId)
                .HasColumnName("ProductModelID")
                .IsRequired()
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);
            Property(x => x.ProductDescriptionId)
                .HasColumnName("ProductDescriptionID")
                .IsRequired()
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);
            Property(x => x.CultureId).HasColumnName("CultureID").IsRequired().HasMaxLength(6);
            Property(x => x.ModifiedDate).HasColumnName("ModifiedDate").IsRequired();
        }
    }
}